<?php require ('./order.php'); ?>
<?php

session_start();  
echo $_SESSION['UserName'];
  if(!empty($_POST['U_OrderId'])){ $U_OrderId=$_POST['U_OrderId']; } 
   if(!empty($_POST['RepalceType'])){ $RepalceType=$_POST['RepalceType']; } 
   if(!empty($_POST['Susers'])){ $Susers=$_POST['Susers']; } 
    if(!empty($_POST['U_OStatus'])){ $U_OStatus=$_POST['U_OStatus']; } 
 if(!empty($_POST['U_ItemCode'])){ $U_ItemCode=$_POST['U_ItemCode']; } 
  if(!empty($_POST['U_CitemCd'])){ $U_CitemCd=$_POST['U_CitemCd']; } 
  //ECHO $RepalceType;
 if($RepalceType=='D1'||$RepalceType=='D2'||$RepalceType=='D3'){

  // $sql= "exec [AX_Replace_Order_Update] '".$U_OrderId."','".$Susers."','".$_SESSION['UserName']."','Susers'";
  // $ddf=odbc_exec($sqlconnection,$sql);
   //echo $sql;

   //odbc_close($sqlconnection);
   $sql1= "exec[AX_Replace_Order_Update] '".$U_OrderId."','".$RepalceType."','".$U_ItemCode."','".$U_CitemCd."','".$_SESSION['UserName']."','U_ReplaceType'";
   $ddf=odbc_exec($sqlconnection,$sql1);
   //echo $sql1;
  }
  //if($RepalceType='D3'){
    // $sql= "exec [AX_Replace_Order_Update] '".$U_OrderId."','".$Susers."','".$_SESSION['UserName']."','Susers'";
  // $ddf=odbc_exec($sqlconnection,$sql);
   //echo $sql;
 // }
  if(isset($U_OrderId)){
   $sql2= "exec [AX_Replace_Order_Update] '".$U_OrderId."','".$U_OStatus."','".$U_ItemCode."','".$U_CitemCd."','".$_SESSION['UserName']."','U_OStatus'";
  //echo $sql2;
   $ddfF=odbc_exec($sqlconnection,$sql2);

   }
   odbc_close($sqlconnection);
  // echo '<option value="'.$row5[$i]['OptionV'].'" >'.iconv("GB18030","utf-8//IGNORE",$row5[$i]['OptionDES']).'</option>';
?>
